﻿using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.ComponentModel;
using System;

namespace CoolCode.Entities
{
    [Table(Name = "dbo.aspnet_Applications")]
    public partial class aspnet_Application : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private string _ApplicationName;

        private string _LoweredApplicationName;

        private System.Guid _ApplicationId;

        private string _Description;

        private EntitySet<aspnet_Membership> _aspnet_Memberships;

        private EntitySet<aspnet_Path> _aspnet_Paths;

        private EntitySet<aspnet_Role> _aspnet_Roles;

        private EntitySet<aspnet_User> _aspnet_Users;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnApplicationNameChanging(string value);
        partial void OnApplicationNameChanged();
        partial void OnLoweredApplicationNameChanging(string value);
        partial void OnLoweredApplicationNameChanged();
        partial void OnApplicationIdChanging(System.Guid value);
        partial void OnApplicationIdChanged();
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        #endregion

        public aspnet_Application()
        {
            this._aspnet_Memberships = new EntitySet<aspnet_Membership>(new Action<aspnet_Membership>(this.attach_aspnet_Memberships), new Action<aspnet_Membership>(this.detach_aspnet_Memberships));
            this._aspnet_Paths = new EntitySet<aspnet_Path>(new Action<aspnet_Path>(this.attach_aspnet_Paths), new Action<aspnet_Path>(this.detach_aspnet_Paths));
            this._aspnet_Roles = new EntitySet<aspnet_Role>(new Action<aspnet_Role>(this.attach_aspnet_Roles), new Action<aspnet_Role>(this.detach_aspnet_Roles));
            this._aspnet_Users = new EntitySet<aspnet_User>(new Action<aspnet_User>(this.attach_aspnet_Users), new Action<aspnet_User>(this.detach_aspnet_Users));
            OnCreated();
        }

        [Column(Storage = "_ApplicationName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string ApplicationName
        {
            get
            {
                return this._ApplicationName;
            }
            set
            {
                if ((this._ApplicationName != value))
                {
                    this.OnApplicationNameChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationName = value;
                    this.SendPropertyChanged("ApplicationName");
                    this.OnApplicationNameChanged();
                }
            }
        }

        [Column(Storage = "_LoweredApplicationName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string LoweredApplicationName
        {
            get
            {
                return this._LoweredApplicationName;
            }
            set
            {
                if ((this._LoweredApplicationName != value))
                {
                    this.OnLoweredApplicationNameChanging(value);
                    this.SendPropertyChanging();
                    this._LoweredApplicationName = value;
                    this.SendPropertyChanged("LoweredApplicationName");
                    this.OnLoweredApplicationNameChanged();
                }
            }
        }

        [Column(Storage = "_ApplicationId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid ApplicationId
        {
            get
            {
                return this._ApplicationId;
            }
            set
            {
                if ((this._ApplicationId != value))
                {
                    this.OnApplicationIdChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationId = value;
                    this.SendPropertyChanged("ApplicationId");
                    this.OnApplicationIdChanged();
                }
            }
        }

        [Column(Storage = "_Description", DbType = "NVarChar(256)")]
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                if ((this._Description != value))
                {
                    this.OnDescriptionChanging(value);
                    this.SendPropertyChanging();
                    this._Description = value;
                    this.SendPropertyChanged("Description");
                    this.OnDescriptionChanged();
                }
            }
        }

        [Association(Name = "aspnet_Application_aspnet_Membership", Storage = "_aspnet_Memberships", ThisKey = "ApplicationId", OtherKey = "ApplicationId")]
        public EntitySet<aspnet_Membership> aspnet_Memberships
        {
            get
            {
                return this._aspnet_Memberships;
            }
            set
            {
                this._aspnet_Memberships.Assign(value);
            }
        }

        [Association(Name = "aspnet_Application_aspnet_Path", Storage = "_aspnet_Paths", ThisKey = "ApplicationId", OtherKey = "ApplicationId")]
        public EntitySet<aspnet_Path> aspnet_Paths
        {
            get
            {
                return this._aspnet_Paths;
            }
            set
            {
                this._aspnet_Paths.Assign(value);
            }
        }

        [Association(Name = "aspnet_Application_aspnet_Role", Storage = "_aspnet_Roles", ThisKey = "ApplicationId", OtherKey = "ApplicationId")]
        public EntitySet<aspnet_Role> aspnet_Roles
        {
            get
            {
                return this._aspnet_Roles;
            }
            set
            {
                this._aspnet_Roles.Assign(value);
            }
        }

        [Association(Name = "aspnet_Application_aspnet_User", Storage = "_aspnet_Users", ThisKey = "ApplicationId", OtherKey = "ApplicationId")]
        public EntitySet<aspnet_User> aspnet_Users
        {
            get
            {
                return this._aspnet_Users;
            }
            set
            {
                this._aspnet_Users.Assign(value);
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private void attach_aspnet_Memberships(aspnet_Membership entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = this;
        }

        private void detach_aspnet_Memberships(aspnet_Membership entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = null;
        }

        private void attach_aspnet_Paths(aspnet_Path entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = this;
        }

        private void detach_aspnet_Paths(aspnet_Path entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = null;
        }

        private void attach_aspnet_Roles(aspnet_Role entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = this;
        }

        private void detach_aspnet_Roles(aspnet_Role entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = null;
        }

        private void attach_aspnet_Users(aspnet_User entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = this;
        }

        private void detach_aspnet_Users(aspnet_User entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Application = null;
        }
    }

    [Table(Name = "dbo.aspnet_WebEvent_Events")]
    public partial class aspnet_WebEvent_Event : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private string _EventId;

        private System.DateTime _EventTimeUtc;

        private System.DateTime _EventTime;

        private string _EventType;

        private decimal _EventSequence;

        private decimal _EventOccurrence;

        private int _EventCode;

        private int _EventDetailCode;

        private string _Message;

        private string _ApplicationPath;

        private string _ApplicationVirtualPath;

        private string _MachineName;

        private string _RequestUrl;

        private string _ExceptionType;

        private string _Details;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnEventIdChanging(string value);
        partial void OnEventIdChanged();
        partial void OnEventTimeUtcChanging(System.DateTime value);
        partial void OnEventTimeUtcChanged();
        partial void OnEventTimeChanging(System.DateTime value);
        partial void OnEventTimeChanged();
        partial void OnEventTypeChanging(string value);
        partial void OnEventTypeChanged();
        partial void OnEventSequenceChanging(decimal value);
        partial void OnEventSequenceChanged();
        partial void OnEventOccurrenceChanging(decimal value);
        partial void OnEventOccurrenceChanged();
        partial void OnEventCodeChanging(int value);
        partial void OnEventCodeChanged();
        partial void OnEventDetailCodeChanging(int value);
        partial void OnEventDetailCodeChanged();
        partial void OnMessageChanging(string value);
        partial void OnMessageChanged();
        partial void OnApplicationPathChanging(string value);
        partial void OnApplicationPathChanged();
        partial void OnApplicationVirtualPathChanging(string value);
        partial void OnApplicationVirtualPathChanged();
        partial void OnMachineNameChanging(string value);
        partial void OnMachineNameChanged();
        partial void OnRequestUrlChanging(string value);
        partial void OnRequestUrlChanged();
        partial void OnExceptionTypeChanging(string value);
        partial void OnExceptionTypeChanged();
        partial void OnDetailsChanging(string value);
        partial void OnDetailsChanged();
        #endregion

        public aspnet_WebEvent_Event()
        {
            OnCreated();
        }

        [Column(Storage = "_EventId", DbType = "Char(32) NOT NULL", CanBeNull = false, IsPrimaryKey = true)]
        public string EventId
        {
            get
            {
                return this._EventId;
            }
            set
            {
                if ((this._EventId != value))
                {
                    this.OnEventIdChanging(value);
                    this.SendPropertyChanging();
                    this._EventId = value;
                    this.SendPropertyChanged("EventId");
                    this.OnEventIdChanged();
                }
            }
        }

        [Column(Storage = "_EventTimeUtc", DbType = "DateTime NOT NULL")]
        public System.DateTime EventTimeUtc
        {
            get
            {
                return this._EventTimeUtc;
            }
            set
            {
                if ((this._EventTimeUtc != value))
                {
                    this.OnEventTimeUtcChanging(value);
                    this.SendPropertyChanging();
                    this._EventTimeUtc = value;
                    this.SendPropertyChanged("EventTimeUtc");
                    this.OnEventTimeUtcChanged();
                }
            }
        }

        [Column(Storage = "_EventTime", DbType = "DateTime NOT NULL")]
        public System.DateTime EventTime
        {
            get
            {
                return this._EventTime;
            }
            set
            {
                if ((this._EventTime != value))
                {
                    this.OnEventTimeChanging(value);
                    this.SendPropertyChanging();
                    this._EventTime = value;
                    this.SendPropertyChanged("EventTime");
                    this.OnEventTimeChanged();
                }
            }
        }

        [Column(Storage = "_EventType", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string EventType
        {
            get
            {
                return this._EventType;
            }
            set
            {
                if ((this._EventType != value))
                {
                    this.OnEventTypeChanging(value);
                    this.SendPropertyChanging();
                    this._EventType = value;
                    this.SendPropertyChanged("EventType");
                    this.OnEventTypeChanged();
                }
            }
        }

        [Column(Storage = "_EventSequence", DbType = "Decimal(19,0) NOT NULL")]
        public decimal EventSequence
        {
            get
            {
                return this._EventSequence;
            }
            set
            {
                if ((this._EventSequence != value))
                {
                    this.OnEventSequenceChanging(value);
                    this.SendPropertyChanging();
                    this._EventSequence = value;
                    this.SendPropertyChanged("EventSequence");
                    this.OnEventSequenceChanged();
                }
            }
        }

        [Column(Storage = "_EventOccurrence", DbType = "Decimal(19,0) NOT NULL")]
        public decimal EventOccurrence
        {
            get
            {
                return this._EventOccurrence;
            }
            set
            {
                if ((this._EventOccurrence != value))
                {
                    this.OnEventOccurrenceChanging(value);
                    this.SendPropertyChanging();
                    this._EventOccurrence = value;
                    this.SendPropertyChanged("EventOccurrence");
                    this.OnEventOccurrenceChanged();
                }
            }
        }

        [Column(Storage = "_EventCode", DbType = "Int NOT NULL")]
        public int EventCode
        {
            get
            {
                return this._EventCode;
            }
            set
            {
                if ((this._EventCode != value))
                {
                    this.OnEventCodeChanging(value);
                    this.SendPropertyChanging();
                    this._EventCode = value;
                    this.SendPropertyChanged("EventCode");
                    this.OnEventCodeChanged();
                }
            }
        }

        [Column(Storage = "_EventDetailCode", DbType = "Int NOT NULL")]
        public int EventDetailCode
        {
            get
            {
                return this._EventDetailCode;
            }
            set
            {
                if ((this._EventDetailCode != value))
                {
                    this.OnEventDetailCodeChanging(value);
                    this.SendPropertyChanging();
                    this._EventDetailCode = value;
                    this.SendPropertyChanged("EventDetailCode");
                    this.OnEventDetailCodeChanged();
                }
            }
        }

        [Column(Storage = "_Message", DbType = "NVarChar(1024)")]
        public string Message
        {
            get
            {
                return this._Message;
            }
            set
            {
                if ((this._Message != value))
                {
                    this.OnMessageChanging(value);
                    this.SendPropertyChanging();
                    this._Message = value;
                    this.SendPropertyChanged("Message");
                    this.OnMessageChanged();
                }
            }
        }

        [Column(Storage = "_ApplicationPath", DbType = "NVarChar(256)")]
        public string ApplicationPath
        {
            get
            {
                return this._ApplicationPath;
            }
            set
            {
                if ((this._ApplicationPath != value))
                {
                    this.OnApplicationPathChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationPath = value;
                    this.SendPropertyChanged("ApplicationPath");
                    this.OnApplicationPathChanged();
                }
            }
        }

        [Column(Storage = "_ApplicationVirtualPath", DbType = "NVarChar(256)")]
        public string ApplicationVirtualPath
        {
            get
            {
                return this._ApplicationVirtualPath;
            }
            set
            {
                if ((this._ApplicationVirtualPath != value))
                {
                    this.OnApplicationVirtualPathChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationVirtualPath = value;
                    this.SendPropertyChanged("ApplicationVirtualPath");
                    this.OnApplicationVirtualPathChanged();
                }
            }
        }

        [Column(Storage = "_MachineName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string MachineName
        {
            get
            {
                return this._MachineName;
            }
            set
            {
                if ((this._MachineName != value))
                {
                    this.OnMachineNameChanging(value);
                    this.SendPropertyChanging();
                    this._MachineName = value;
                    this.SendPropertyChanged("MachineName");
                    this.OnMachineNameChanged();
                }
            }
        }

        [Column(Storage = "_RequestUrl", DbType = "NVarChar(1024)")]
        public string RequestUrl
        {
            get
            {
                return this._RequestUrl;
            }
            set
            {
                if ((this._RequestUrl != value))
                {
                    this.OnRequestUrlChanging(value);
                    this.SendPropertyChanging();
                    this._RequestUrl = value;
                    this.SendPropertyChanged("RequestUrl");
                    this.OnRequestUrlChanged();
                }
            }
        }

        [Column(Storage = "_ExceptionType", DbType = "NVarChar(256)")]
        public string ExceptionType
        {
            get
            {
                return this._ExceptionType;
            }
            set
            {
                if ((this._ExceptionType != value))
                {
                    this.OnExceptionTypeChanging(value);
                    this.SendPropertyChanging();
                    this._ExceptionType = value;
                    this.SendPropertyChanged("ExceptionType");
                    this.OnExceptionTypeChanged();
                }
            }
        }

        [Column(Storage = "_Details",  UpdateCheck = UpdateCheck.Never)]
        public string Details
        {
            get
            {
                return this._Details;
            }
            set
            {
                if ((this._Details != value))
                {
                    this.OnDetailsChanging(value);
                    this.SendPropertyChanging();
                    this._Details = value;
                    this.SendPropertyChanged("Details");
                    this.OnDetailsChanged();
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }


    [Table(Name = "dbo.aspnet_Membership")]
    public partial class aspnet_Membership : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _ApplicationId;

        private System.Guid _UserId;

        private string _Password;

        private int _PasswordFormat;

        private string _PasswordSalt;

        private string _MobilePIN;

        private string _Email;

        private string _LoweredEmail;

        private string _PasswordQuestion;

        private string _PasswordAnswer;

        private bool _IsApproved;

        private bool _IsLockedOut;

        private System.DateTime _CreateDate;

        private System.DateTime _LastLoginDate;

        private System.DateTime _LastPasswordChangedDate;

        private System.DateTime _LastLockoutDate;

        private int _FailedPasswordAttemptCount;

        private System.DateTime _FailedPasswordAttemptWindowStart;

        private int _FailedPasswordAnswerAttemptCount;

        private System.DateTime _FailedPasswordAnswerAttemptWindowStart;

        private string _Comment;

        private EntityRef<aspnet_Application> _aspnet_Application;

        private EntityRef<aspnet_User> _aspnet_User;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnApplicationIdChanging(System.Guid value);
        partial void OnApplicationIdChanged();
        partial void OnUserIdChanging(System.Guid value);
        partial void OnUserIdChanged();
        partial void OnPasswordChanging(string value);
        partial void OnPasswordChanged();
        partial void OnPasswordFormatChanging(int value);
        partial void OnPasswordFormatChanged();
        partial void OnPasswordSaltChanging(string value);
        partial void OnPasswordSaltChanged();
        partial void OnMobilePINChanging(string value);
        partial void OnMobilePINChanged();
        partial void OnEmailChanging(string value);
        partial void OnEmailChanged();
        partial void OnLoweredEmailChanging(string value);
        partial void OnLoweredEmailChanged();
        partial void OnPasswordQuestionChanging(string value);
        partial void OnPasswordQuestionChanged();
        partial void OnPasswordAnswerChanging(string value);
        partial void OnPasswordAnswerChanged();
        partial void OnIsApprovedChanging(bool value);
        partial void OnIsApprovedChanged();
        partial void OnIsLockedOutChanging(bool value);
        partial void OnIsLockedOutChanged();
        partial void OnCreateDateChanging(System.DateTime value);
        partial void OnCreateDateChanged();
        partial void OnLastLoginDateChanging(System.DateTime value);
        partial void OnLastLoginDateChanged();
        partial void OnLastPasswordChangedDateChanging(System.DateTime value);
        partial void OnLastPasswordChangedDateChanged();
        partial void OnLastLockoutDateChanging(System.DateTime value);
        partial void OnLastLockoutDateChanged();
        partial void OnFailedPasswordAttemptCountChanging(int value);
        partial void OnFailedPasswordAttemptCountChanged();
        partial void OnFailedPasswordAttemptWindowStartChanging(System.DateTime value);
        partial void OnFailedPasswordAttemptWindowStartChanged();
        partial void OnFailedPasswordAnswerAttemptCountChanging(int value);
        partial void OnFailedPasswordAnswerAttemptCountChanged();
        partial void OnFailedPasswordAnswerAttemptWindowStartChanging(System.DateTime value);
        partial void OnFailedPasswordAnswerAttemptWindowStartChanged();
        partial void OnCommentChanging(string value);
        partial void OnCommentChanged();
        #endregion

        public aspnet_Membership()
        {
            this._aspnet_Application = default(EntityRef<aspnet_Application>);
            this._aspnet_User = default(EntityRef<aspnet_User>);
            OnCreated();
        }

        [Column(Storage = "_ApplicationId", DbType = "UniqueIdentifier NOT NULL")]
        public System.Guid ApplicationId
        {
            get
            {
                return this._ApplicationId;
            }
            set
            {
                if ((this._ApplicationId != value))
                {
                    if (this._aspnet_Application.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnApplicationIdChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationId = value;
                    this.SendPropertyChanged("ApplicationId");
                    this.OnApplicationIdChanged();
                }
            }
        }

        [Column(Storage = "_UserId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid UserId
        {
            get
            {
                return this._UserId;
            }
            set
            {
                if ((this._UserId != value))
                {
                    if (this._aspnet_User.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnUserIdChanging(value);
                    this.SendPropertyChanging();
                    this._UserId = value;
                    this.SendPropertyChanged("UserId");
                    this.OnUserIdChanged();
                }
            }
        }

        [Column(Storage = "_Password", DbType = "NVarChar(128) NOT NULL", CanBeNull = false)]
        public string Password
        {
            get
            {
                return this._Password;
            }
            set
            {
                if ((this._Password != value))
                {
                    this.OnPasswordChanging(value);
                    this.SendPropertyChanging();
                    this._Password = value;
                    this.SendPropertyChanged("Password");
                    this.OnPasswordChanged();
                }
            }
        }

        [Column(Storage = "_PasswordFormat", DbType = "Int NOT NULL")]
        public int PasswordFormat
        {
            get
            {
                return this._PasswordFormat;
            }
            set
            {
                if ((this._PasswordFormat != value))
                {
                    this.OnPasswordFormatChanging(value);
                    this.SendPropertyChanging();
                    this._PasswordFormat = value;
                    this.SendPropertyChanged("PasswordFormat");
                    this.OnPasswordFormatChanged();
                }
            }
        }

        [Column(Storage = "_PasswordSalt", DbType = "NVarChar(128) NOT NULL", CanBeNull = false)]
        public string PasswordSalt
        {
            get
            {
                return this._PasswordSalt;
            }
            set
            {
                if ((this._PasswordSalt != value))
                {
                    this.OnPasswordSaltChanging(value);
                    this.SendPropertyChanging();
                    this._PasswordSalt = value;
                    this.SendPropertyChanged("PasswordSalt");
                    this.OnPasswordSaltChanged();
                }
            }
        }

        [Column(Storage = "_MobilePIN", DbType = "NVarChar(16)")]
        public string MobilePIN
        {
            get
            {
                return this._MobilePIN;
            }
            set
            {
                if ((this._MobilePIN != value))
                {
                    this.OnMobilePINChanging(value);
                    this.SendPropertyChanging();
                    this._MobilePIN = value;
                    this.SendPropertyChanged("MobilePIN");
                    this.OnMobilePINChanged();
                }
            }
        }

        [Column(Storage = "_Email", DbType = "NVarChar(256)")]
        public string Email
        {
            get
            {
                return this._Email;
            }
            set
            {
                if ((this._Email != value))
                {
                    this.OnEmailChanging(value);
                    this.SendPropertyChanging();
                    this._Email = value;
                    this.SendPropertyChanged("Email");
                    this.OnEmailChanged();
                }
            }
        }

        [Column(Storage = "_LoweredEmail", DbType = "NVarChar(256)")]
        public string LoweredEmail
        {
            get
            {
                return this._LoweredEmail;
            }
            set
            {
                if ((this._LoweredEmail != value))
                {
                    this.OnLoweredEmailChanging(value);
                    this.SendPropertyChanging();
                    this._LoweredEmail = value;
                    this.SendPropertyChanged("LoweredEmail");
                    this.OnLoweredEmailChanged();
                }
            }
        }

        [Column(Storage = "_PasswordQuestion", DbType = "NVarChar(256)")]
        public string PasswordQuestion
        {
            get
            {
                return this._PasswordQuestion;
            }
            set
            {
                if ((this._PasswordQuestion != value))
                {
                    this.OnPasswordQuestionChanging(value);
                    this.SendPropertyChanging();
                    this._PasswordQuestion = value;
                    this.SendPropertyChanged("PasswordQuestion");
                    this.OnPasswordQuestionChanged();
                }
            }
        }

        [Column(Storage = "_PasswordAnswer", DbType = "NVarChar(128)")]
        public string PasswordAnswer
        {
            get
            {
                return this._PasswordAnswer;
            }
            set
            {
                if ((this._PasswordAnswer != value))
                {
                    this.OnPasswordAnswerChanging(value);
                    this.SendPropertyChanging();
                    this._PasswordAnswer = value;
                    this.SendPropertyChanged("PasswordAnswer");
                    this.OnPasswordAnswerChanged();
                }
            }
        }

        [Column(Storage = "_IsApproved", DbType = "Bit NOT NULL")]
        public bool IsApproved
        {
            get
            {
                return this._IsApproved;
            }
            set
            {
                if ((this._IsApproved != value))
                {
                    this.OnIsApprovedChanging(value);
                    this.SendPropertyChanging();
                    this._IsApproved = value;
                    this.SendPropertyChanged("IsApproved");
                    this.OnIsApprovedChanged();
                }
            }
        }

        [Column(Storage = "_IsLockedOut", DbType = "Bit NOT NULL")]
        public bool IsLockedOut
        {
            get
            {
                return this._IsLockedOut;
            }
            set
            {
                if ((this._IsLockedOut != value))
                {
                    this.OnIsLockedOutChanging(value);
                    this.SendPropertyChanging();
                    this._IsLockedOut = value;
                    this.SendPropertyChanged("IsLockedOut");
                    this.OnIsLockedOutChanged();
                }
            }
        }

        [Column(Storage = "_CreateDate", DbType = "DateTime NOT NULL")]
        public System.DateTime CreateDate
        {
            get
            {
                return this._CreateDate;
            }
            set
            {
                if ((this._CreateDate != value))
                {
                    this.OnCreateDateChanging(value);
                    this.SendPropertyChanging();
                    this._CreateDate = value;
                    this.SendPropertyChanged("CreateDate");
                    this.OnCreateDateChanged();
                }
            }
        }

        [Column(Storage = "_LastLoginDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastLoginDate
        {
            get
            {
                return this._LastLoginDate;
            }
            set
            {
                if ((this._LastLoginDate != value))
                {
                    this.OnLastLoginDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastLoginDate = value;
                    this.SendPropertyChanged("LastLoginDate");
                    this.OnLastLoginDateChanged();
                }
            }
        }

        [Column(Storage = "_LastPasswordChangedDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastPasswordChangedDate
        {
            get
            {
                return this._LastPasswordChangedDate;
            }
            set
            {
                if ((this._LastPasswordChangedDate != value))
                {
                    this.OnLastPasswordChangedDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastPasswordChangedDate = value;
                    this.SendPropertyChanged("LastPasswordChangedDate");
                    this.OnLastPasswordChangedDateChanged();
                }
            }
        }

        [Column(Storage = "_LastLockoutDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastLockoutDate
        {
            get
            {
                return this._LastLockoutDate;
            }
            set
            {
                if ((this._LastLockoutDate != value))
                {
                    this.OnLastLockoutDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastLockoutDate = value;
                    this.SendPropertyChanged("LastLockoutDate");
                    this.OnLastLockoutDateChanged();
                }
            }
        }

        [Column(Storage = "_FailedPasswordAttemptCount", DbType = "Int NOT NULL")]
        public int FailedPasswordAttemptCount
        {
            get
            {
                return this._FailedPasswordAttemptCount;
            }
            set
            {
                if ((this._FailedPasswordAttemptCount != value))
                {
                    this.OnFailedPasswordAttemptCountChanging(value);
                    this.SendPropertyChanging();
                    this._FailedPasswordAttemptCount = value;
                    this.SendPropertyChanged("FailedPasswordAttemptCount");
                    this.OnFailedPasswordAttemptCountChanged();
                }
            }
        }

        [Column(Storage = "_FailedPasswordAttemptWindowStart", DbType = "DateTime NOT NULL")]
        public System.DateTime FailedPasswordAttemptWindowStart
        {
            get
            {
                return this._FailedPasswordAttemptWindowStart;
            }
            set
            {
                if ((this._FailedPasswordAttemptWindowStart != value))
                {
                    this.OnFailedPasswordAttemptWindowStartChanging(value);
                    this.SendPropertyChanging();
                    this._FailedPasswordAttemptWindowStart = value;
                    this.SendPropertyChanged("FailedPasswordAttemptWindowStart");
                    this.OnFailedPasswordAttemptWindowStartChanged();
                }
            }
        }

        [Column(Storage = "_FailedPasswordAnswerAttemptCount", DbType = "Int NOT NULL")]
        public int FailedPasswordAnswerAttemptCount
        {
            get
            {
                return this._FailedPasswordAnswerAttemptCount;
            }
            set
            {
                if ((this._FailedPasswordAnswerAttemptCount != value))
                {
                    this.OnFailedPasswordAnswerAttemptCountChanging(value);
                    this.SendPropertyChanging();
                    this._FailedPasswordAnswerAttemptCount = value;
                    this.SendPropertyChanged("FailedPasswordAnswerAttemptCount");
                    this.OnFailedPasswordAnswerAttemptCountChanged();
                }
            }
        }

        [Column(Storage = "_FailedPasswordAnswerAttemptWindowStart", DbType = "DateTime NOT NULL")]
        public System.DateTime FailedPasswordAnswerAttemptWindowStart
        {
            get
            {
                return this._FailedPasswordAnswerAttemptWindowStart;
            }
            set
            {
                if ((this._FailedPasswordAnswerAttemptWindowStart != value))
                {
                    this.OnFailedPasswordAnswerAttemptWindowStartChanging(value);
                    this.SendPropertyChanging();
                    this._FailedPasswordAnswerAttemptWindowStart = value;
                    this.SendPropertyChanged("FailedPasswordAnswerAttemptWindowStart");
                    this.OnFailedPasswordAnswerAttemptWindowStartChanged();
                }
            }
        }

        [Column(Storage = "_Comment",  UpdateCheck = UpdateCheck.Never)]
        public string Comment
        {
            get
            {
                return this._Comment;
            }
            set
            {
                if ((this._Comment != value))
                {
                    this.OnCommentChanging(value);
                    this.SendPropertyChanging();
                    this._Comment = value;
                    this.SendPropertyChanged("Comment");
                    this.OnCommentChanged();
                }
            }
        }

        [Association(Name = "aspnet_Application_aspnet_Membership", Storage = "_aspnet_Application", ThisKey = "ApplicationId", OtherKey = "ApplicationId", IsForeignKey = true)]
        public aspnet_Application aspnet_Application
        {
            get
            {
                return this._aspnet_Application.Entity;
            }
            set
            {
                aspnet_Application previousValue = this._aspnet_Application.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Application.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Application.Entity = null;
                        previousValue.aspnet_Memberships.Remove(this);
                    }
                    this._aspnet_Application.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Memberships.Add(this);
                        this._ApplicationId = value.ApplicationId;
                    }
                    else
                    {
                        this._ApplicationId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_Application");
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_Membership", Storage = "_aspnet_User", ThisKey = "UserId", OtherKey = "UserId", IsForeignKey = true)]
        public aspnet_User aspnet_User
        {
            get
            {
                return this._aspnet_User.Entity;
            }
            set
            {
                aspnet_User previousValue = this._aspnet_User.Entity;
                if (((previousValue != value)
                            || (this._aspnet_User.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_User.Entity = null;
                        previousValue.aspnet_Membership = null;
                    }
                    this._aspnet_User.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Membership = this;
                        this._UserId = value.UserId;
                    }
                    else
                    {
                        this._UserId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_User");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [Table(Name = "dbo.aspnet_Paths")]
    public partial class aspnet_Path : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _ApplicationId;

        private System.Guid _PathId;

        private string _Path;

        private string _LoweredPath;

        private EntityRef<aspnet_PersonalizationAllUser> _aspnet_PersonalizationAllUser;

        private EntitySet<aspnet_PersonalizationPerUser> _aspnet_PersonalizationPerUsers;

        private EntityRef<aspnet_Application> _aspnet_Application;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnApplicationIdChanging(System.Guid value);
        partial void OnApplicationIdChanged();
        partial void OnPathIdChanging(System.Guid value);
        partial void OnPathIdChanged();
        partial void OnPathChanging(string value);
        partial void OnPathChanged();
        partial void OnLoweredPathChanging(string value);
        partial void OnLoweredPathChanged();
        #endregion

        public aspnet_Path()
        {
            this._aspnet_PersonalizationAllUser = default(EntityRef<aspnet_PersonalizationAllUser>);
            this._aspnet_PersonalizationPerUsers = new EntitySet<aspnet_PersonalizationPerUser>(new Action<aspnet_PersonalizationPerUser>(this.attach_aspnet_PersonalizationPerUsers), new Action<aspnet_PersonalizationPerUser>(this.detach_aspnet_PersonalizationPerUsers));
            this._aspnet_Application = default(EntityRef<aspnet_Application>);
            OnCreated();
        }

        [Column(Storage = "_ApplicationId", DbType = "UniqueIdentifier NOT NULL")]
        public System.Guid ApplicationId
        {
            get
            {
                return this._ApplicationId;
            }
            set
            {
                if ((this._ApplicationId != value))
                {
                    if (this._aspnet_Application.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnApplicationIdChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationId = value;
                    this.SendPropertyChanged("ApplicationId");
                    this.OnApplicationIdChanged();
                }
            }
        }

        [Column(Storage = "_PathId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid PathId
        {
            get
            {
                return this._PathId;
            }
            set
            {
                if ((this._PathId != value))
                {
                    this.OnPathIdChanging(value);
                    this.SendPropertyChanging();
                    this._PathId = value;
                    this.SendPropertyChanged("PathId");
                    this.OnPathIdChanged();
                }
            }
        }

        [Column(Storage = "_Path", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string Path
        {
            get
            {
                return this._Path;
            }
            set
            {
                if ((this._Path != value))
                {
                    this.OnPathChanging(value);
                    this.SendPropertyChanging();
                    this._Path = value;
                    this.SendPropertyChanged("Path");
                    this.OnPathChanged();
                }
            }
        }

        [Column(Storage = "_LoweredPath", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string LoweredPath
        {
            get
            {
                return this._LoweredPath;
            }
            set
            {
                if ((this._LoweredPath != value))
                {
                    this.OnLoweredPathChanging(value);
                    this.SendPropertyChanging();
                    this._LoweredPath = value;
                    this.SendPropertyChanged("LoweredPath");
                    this.OnLoweredPathChanged();
                }
            }
        }

        [Association(Name = "aspnet_Path_aspnet_PersonalizationAllUser", Storage = "_aspnet_PersonalizationAllUser", ThisKey = "PathId", OtherKey = "PathId", IsUnique = true, IsForeignKey = false)]
        public aspnet_PersonalizationAllUser aspnet_PersonalizationAllUser
        {
            get
            {
                return this._aspnet_PersonalizationAllUser.Entity;
            }
            set
            {
                aspnet_PersonalizationAllUser previousValue = this._aspnet_PersonalizationAllUser.Entity;
                if (((previousValue != value)
                            || (this._aspnet_PersonalizationAllUser.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_PersonalizationAllUser.Entity = null;
                        previousValue.aspnet_Path = null;
                    }
                    this._aspnet_PersonalizationAllUser.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Path = this;
                    }
                    this.SendPropertyChanged("aspnet_PersonalizationAllUser");
                }
            }
        }

        [Association(Name = "aspnet_Path_aspnet_PersonalizationPerUser", Storage = "_aspnet_PersonalizationPerUsers", ThisKey = "PathId", OtherKey = "PathId")]
        public EntitySet<aspnet_PersonalizationPerUser> aspnet_PersonalizationPerUsers
        {
            get
            {
                return this._aspnet_PersonalizationPerUsers;
            }
            set
            {
                this._aspnet_PersonalizationPerUsers.Assign(value);
            }
        }

        [Association(Name = "aspnet_Application_aspnet_Path", Storage = "_aspnet_Application", ThisKey = "ApplicationId", OtherKey = "ApplicationId", IsForeignKey = true)]
        public aspnet_Application aspnet_Application
        {
            get
            {
                return this._aspnet_Application.Entity;
            }
            set
            {
                aspnet_Application previousValue = this._aspnet_Application.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Application.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Application.Entity = null;
                        previousValue.aspnet_Paths.Remove(this);
                    }
                    this._aspnet_Application.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Paths.Add(this);
                        this._ApplicationId = value.ApplicationId;
                    }
                    else
                    {
                        this._ApplicationId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_Application");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private void attach_aspnet_PersonalizationPerUsers(aspnet_PersonalizationPerUser entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Path = this;
        }

        private void detach_aspnet_PersonalizationPerUsers(aspnet_PersonalizationPerUser entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Path = null;
        }
    }

    [Table(Name = "dbo.aspnet_PersonalizationAllUsers")]
    public partial class aspnet_PersonalizationAllUser : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _PathId;

        private System.Data.Linq.Binary _PageSettings;

        private System.DateTime _LastUpdatedDate;

        private EntityRef<aspnet_Path> _aspnet_Path;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnPathIdChanging(System.Guid value);
        partial void OnPathIdChanged();
        partial void OnPageSettingsChanging(System.Data.Linq.Binary value);
        partial void OnPageSettingsChanged();
        partial void OnLastUpdatedDateChanging(System.DateTime value);
        partial void OnLastUpdatedDateChanged();
        #endregion

        public aspnet_PersonalizationAllUser()
        {
            this._aspnet_Path = default(EntityRef<aspnet_Path>);
            OnCreated();
        }

        [Column(Storage = "_PathId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid PathId
        {
            get
            {
                return this._PathId;
            }
            set
            {
                if ((this._PathId != value))
                {
                    if (this._aspnet_Path.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnPathIdChanging(value);
                    this.SendPropertyChanging();
                    this._PathId = value;
                    this.SendPropertyChanged("PathId");
                    this.OnPathIdChanged();
                }
            }
        }

        [Column(Storage = "_PageSettings", DbType = "Image NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public System.Data.Linq.Binary PageSettings
        {
            get
            {
                return this._PageSettings;
            }
            set
            {
                if ((this._PageSettings != value))
                {
                    this.OnPageSettingsChanging(value);
                    this.SendPropertyChanging();
                    this._PageSettings = value;
                    this.SendPropertyChanged("PageSettings");
                    this.OnPageSettingsChanged();
                }
            }
        }

        [Column(Storage = "_LastUpdatedDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastUpdatedDate
        {
            get
            {
                return this._LastUpdatedDate;
            }
            set
            {
                if ((this._LastUpdatedDate != value))
                {
                    this.OnLastUpdatedDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastUpdatedDate = value;
                    this.SendPropertyChanged("LastUpdatedDate");
                    this.OnLastUpdatedDateChanged();
                }
            }
        }

        [Association(Name = "aspnet_Path_aspnet_PersonalizationAllUser", Storage = "_aspnet_Path", ThisKey = "PathId", OtherKey = "PathId", IsForeignKey = true)]
        public aspnet_Path aspnet_Path
        {
            get
            {
                return this._aspnet_Path.Entity;
            }
            set
            {
                aspnet_Path previousValue = this._aspnet_Path.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Path.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Path.Entity = null;
                        previousValue.aspnet_PersonalizationAllUser = null;
                    }
                    this._aspnet_Path.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_PersonalizationAllUser = this;
                        this._PathId = value.PathId;
                    }
                    else
                    {
                        this._PathId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_Path");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [Table(Name = "dbo.aspnet_PersonalizationPerUser")]
    public partial class aspnet_PersonalizationPerUser : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _Id;

        private System.Nullable<System.Guid> _PathId;

        private System.Nullable<System.Guid> _UserId;

        private System.Data.Linq.Binary _PageSettings;

        private System.DateTime _LastUpdatedDate;

        private EntityRef<aspnet_Path> _aspnet_Path;

        private EntityRef<aspnet_User> _aspnet_User;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(System.Guid value);
        partial void OnIdChanged();
        partial void OnPathIdChanging(System.Nullable<System.Guid> value);
        partial void OnPathIdChanged();
        partial void OnUserIdChanging(System.Nullable<System.Guid> value);
        partial void OnUserIdChanged();
        partial void OnPageSettingsChanging(System.Data.Linq.Binary value);
        partial void OnPageSettingsChanged();
        partial void OnLastUpdatedDateChanging(System.DateTime value);
        partial void OnLastUpdatedDateChanged();
        #endregion

        public aspnet_PersonalizationPerUser()
        {
            this._aspnet_Path = default(EntityRef<aspnet_Path>);
            this._aspnet_User = default(EntityRef<aspnet_User>);
            OnCreated();
        }

        [Column(Storage = "_Id", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        [Column(Storage = "_PathId", DbType = "UniqueIdentifier")]
        public System.Nullable<System.Guid> PathId
        {
            get
            {
                return this._PathId;
            }
            set
            {
                if ((this._PathId != value))
                {
                    if (this._aspnet_Path.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnPathIdChanging(value);
                    this.SendPropertyChanging();
                    this._PathId = value;
                    this.SendPropertyChanged("PathId");
                    this.OnPathIdChanged();
                }
            }
        }

        [Column(Storage = "_UserId", DbType = "UniqueIdentifier")]
        public System.Nullable<System.Guid> UserId
        {
            get
            {
                return this._UserId;
            }
            set
            {
                if ((this._UserId != value))
                {
                    if (this._aspnet_User.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnUserIdChanging(value);
                    this.SendPropertyChanging();
                    this._UserId = value;
                    this.SendPropertyChanged("UserId");
                    this.OnUserIdChanged();
                }
            }
        }

        [Column(Storage = "_PageSettings", DbType = "Image NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public System.Data.Linq.Binary PageSettings
        {
            get
            {
                return this._PageSettings;
            }
            set
            {
                if ((this._PageSettings != value))
                {
                    this.OnPageSettingsChanging(value);
                    this.SendPropertyChanging();
                    this._PageSettings = value;
                    this.SendPropertyChanged("PageSettings");
                    this.OnPageSettingsChanged();
                }
            }
        }

        [Column(Storage = "_LastUpdatedDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastUpdatedDate
        {
            get
            {
                return this._LastUpdatedDate;
            }
            set
            {
                if ((this._LastUpdatedDate != value))
                {
                    this.OnLastUpdatedDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastUpdatedDate = value;
                    this.SendPropertyChanged("LastUpdatedDate");
                    this.OnLastUpdatedDateChanged();
                }
            }
        }

        [Association(Name = "aspnet_Path_aspnet_PersonalizationPerUser", Storage = "_aspnet_Path", ThisKey = "PathId", OtherKey = "PathId", IsForeignKey = true)]
        public aspnet_Path aspnet_Path
        {
            get
            {
                return this._aspnet_Path.Entity;
            }
            set
            {
                aspnet_Path previousValue = this._aspnet_Path.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Path.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Path.Entity = null;
                        previousValue.aspnet_PersonalizationPerUsers.Remove(this);
                    }
                    this._aspnet_Path.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_PersonalizationPerUsers.Add(this);
                        this._PathId = value.PathId;
                    }
                    else
                    {
                        this._PathId = default(Nullable<System.Guid>);
                    }
                    this.SendPropertyChanged("aspnet_Path");
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_PersonalizationPerUser", Storage = "_aspnet_User", ThisKey = "UserId", OtherKey = "UserId", IsForeignKey = true)]
        public aspnet_User aspnet_User
        {
            get
            {
                return this._aspnet_User.Entity;
            }
            set
            {
                aspnet_User previousValue = this._aspnet_User.Entity;
                if (((previousValue != value)
                            || (this._aspnet_User.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_User.Entity = null;
                        previousValue.aspnet_PersonalizationPerUsers.Remove(this);
                    }
                    this._aspnet_User.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_PersonalizationPerUsers.Add(this);
                        this._UserId = value.UserId;
                    }
                    else
                    {
                        this._UserId = default(Nullable<System.Guid>);
                    }
                    this.SendPropertyChanged("aspnet_User");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [Table(Name = "dbo.aspnet_Profile")]
    public partial class aspnet_Profile : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _UserId;

        private string _PropertyNames;

        private string _PropertyValuesString;

        private System.Data.Linq.Binary _PropertyValuesBinary;

        private System.DateTime _LastUpdatedDate;

        private EntityRef<aspnet_User> _aspnet_User;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnUserIdChanging(System.Guid value);
        partial void OnUserIdChanged();
        partial void OnPropertyNamesChanging(string value);
        partial void OnPropertyNamesChanged();
        partial void OnPropertyValuesStringChanging(string value);
        partial void OnPropertyValuesStringChanged();
        partial void OnPropertyValuesBinaryChanging(System.Data.Linq.Binary value);
        partial void OnPropertyValuesBinaryChanged();
        partial void OnLastUpdatedDateChanging(System.DateTime value);
        partial void OnLastUpdatedDateChanged();
        #endregion

        public aspnet_Profile()
        {
            this._aspnet_User = default(EntityRef<aspnet_User>);
            OnCreated();
        }

        [Column(Storage = "_UserId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid UserId
        {
            get
            {
                return this._UserId;
            }
            set
            {
                if ((this._UserId != value))
                {
                    if (this._aspnet_User.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnUserIdChanging(value);
                    this.SendPropertyChanging();
                    this._UserId = value;
                    this.SendPropertyChanged("UserId");
                    this.OnUserIdChanged();
                }
            }
        }

        [Column(Storage = "_PropertyNames", DbType = "NText NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public string PropertyNames
        {
            get
            {
                return this._PropertyNames;
            }
            set
            {
                if ((this._PropertyNames != value))
                {
                    this.OnPropertyNamesChanging(value);
                    this.SendPropertyChanging();
                    this._PropertyNames = value;
                    this.SendPropertyChanged("PropertyNames");
                    this.OnPropertyNamesChanged();
                }
            }
        }

        [Column(Storage = "_PropertyValuesString", DbType = "NText NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public string PropertyValuesString
        {
            get
            {
                return this._PropertyValuesString;
            }
            set
            {
                if ((this._PropertyValuesString != value))
                {
                    this.OnPropertyValuesStringChanging(value);
                    this.SendPropertyChanging();
                    this._PropertyValuesString = value;
                    this.SendPropertyChanged("PropertyValuesString");
                    this.OnPropertyValuesStringChanged();
                }
            }
        }

        [Column(Storage = "_PropertyValuesBinary", DbType = "Image NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public System.Data.Linq.Binary PropertyValuesBinary
        {
            get
            {
                return this._PropertyValuesBinary;
            }
            set
            {
                if ((this._PropertyValuesBinary != value))
                {
                    this.OnPropertyValuesBinaryChanging(value);
                    this.SendPropertyChanging();
                    this._PropertyValuesBinary = value;
                    this.SendPropertyChanged("PropertyValuesBinary");
                    this.OnPropertyValuesBinaryChanged();
                }
            }
        }

        [Column(Storage = "_LastUpdatedDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastUpdatedDate
        {
            get
            {
                return this._LastUpdatedDate;
            }
            set
            {
                if ((this._LastUpdatedDate != value))
                {
                    this.OnLastUpdatedDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastUpdatedDate = value;
                    this.SendPropertyChanged("LastUpdatedDate");
                    this.OnLastUpdatedDateChanged();
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_Profile", Storage = "_aspnet_User", ThisKey = "UserId", OtherKey = "UserId", IsForeignKey = true)]
        public aspnet_User aspnet_User
        {
            get
            {
                return this._aspnet_User.Entity;
            }
            set
            {
                aspnet_User previousValue = this._aspnet_User.Entity;
                if (((previousValue != value)
                            || (this._aspnet_User.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_User.Entity = null;
                        previousValue.aspnet_Profile = null;
                    }
                    this._aspnet_User.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Profile = this;
                        this._UserId = value.UserId;
                    }
                    else
                    {
                        this._UserId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_User");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [Table(Name = "dbo.aspnet_Roles")]
    public partial class aspnet_Role : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _ApplicationId;

        private System.Guid _RoleId;

        private string _RoleName;

        private string _LoweredRoleName;

        private string _Description;

        private EntitySet<aspnet_UsersInRole> _aspnet_UsersInRoles;

        private EntityRef<aspnet_Application> _aspnet_Application;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnApplicationIdChanging(System.Guid value);
        partial void OnApplicationIdChanged();
        partial void OnRoleIdChanging(System.Guid value);
        partial void OnRoleIdChanged();
        partial void OnRoleNameChanging(string value);
        partial void OnRoleNameChanged();
        partial void OnLoweredRoleNameChanging(string value);
        partial void OnLoweredRoleNameChanged();
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        #endregion

        public aspnet_Role()
        {
            this._aspnet_UsersInRoles = new EntitySet<aspnet_UsersInRole>(new Action<aspnet_UsersInRole>(this.attach_aspnet_UsersInRoles), new Action<aspnet_UsersInRole>(this.detach_aspnet_UsersInRoles));
            this._aspnet_Application = default(EntityRef<aspnet_Application>);
            OnCreated();
        }

        [Column(Storage = "_ApplicationId", DbType = "UniqueIdentifier NOT NULL")]
        public System.Guid ApplicationId
        {
            get
            {
                return this._ApplicationId;
            }
            set
            {
                if ((this._ApplicationId != value))
                {
                    if (this._aspnet_Application.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnApplicationIdChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationId = value;
                    this.SendPropertyChanged("ApplicationId");
                    this.OnApplicationIdChanged();
                }
            }
        }

        [Column(Storage = "_RoleId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid RoleId
        {
            get
            {
                return this._RoleId;
            }
            set
            {
                if ((this._RoleId != value))
                {
                    this.OnRoleIdChanging(value);
                    this.SendPropertyChanging();
                    this._RoleId = value;
                    this.SendPropertyChanged("RoleId");
                    this.OnRoleIdChanged();
                }
            }
        }

        [Column(Storage = "_RoleName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string RoleName
        {
            get
            {
                return this._RoleName;
            }
            set
            {
                if ((this._RoleName != value))
                {
                    this.OnRoleNameChanging(value);
                    this.SendPropertyChanging();
                    this._RoleName = value;
                    this.SendPropertyChanged("RoleName");
                    this.OnRoleNameChanged();
                }
            }
        }

        [Column(Storage = "_LoweredRoleName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string LoweredRoleName
        {
            get
            {
                return this._LoweredRoleName;
            }
            set
            {
                if ((this._LoweredRoleName != value))
                {
                    this.OnLoweredRoleNameChanging(value);
                    this.SendPropertyChanging();
                    this._LoweredRoleName = value;
                    this.SendPropertyChanged("LoweredRoleName");
                    this.OnLoweredRoleNameChanged();
                }
            }
        }

        [Column(Storage = "_Description", DbType = "NVarChar(256)")]
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                if ((this._Description != value))
                {
                    this.OnDescriptionChanging(value);
                    this.SendPropertyChanging();
                    this._Description = value;
                    this.SendPropertyChanged("Description");
                    this.OnDescriptionChanged();
                }
            }
        }

        [Association(Name = "aspnet_Role_aspnet_UsersInRole", Storage = "_aspnet_UsersInRoles", ThisKey = "RoleId", OtherKey = "RoleId")]
        public EntitySet<aspnet_UsersInRole> aspnet_UsersInRoles
        {
            get
            {
                return this._aspnet_UsersInRoles;
            }
            set
            {
                this._aspnet_UsersInRoles.Assign(value);
            }
        }

        [Association(Name = "aspnet_Application_aspnet_Role", Storage = "_aspnet_Application", ThisKey = "ApplicationId", OtherKey = "ApplicationId", IsForeignKey = true)]
        public aspnet_Application aspnet_Application
        {
            get
            {
                return this._aspnet_Application.Entity;
            }
            set
            {
                aspnet_Application previousValue = this._aspnet_Application.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Application.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Application.Entity = null;
                        previousValue.aspnet_Roles.Remove(this);
                    }
                    this._aspnet_Application.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Roles.Add(this);
                        this._ApplicationId = value.ApplicationId;
                    }
                    else
                    {
                        this._ApplicationId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_Application");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private void attach_aspnet_UsersInRoles(aspnet_UsersInRole entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Role = this;
        }

        private void detach_aspnet_UsersInRoles(aspnet_UsersInRole entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_Role = null;
        }
    }

    [Table(Name = "dbo.aspnet_SchemaVersions")]
    public partial class aspnet_SchemaVersion : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private string _Feature;

        private string _CompatibleSchemaVersion;

        private bool _IsCurrentVersion;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnFeatureChanging(string value);
        partial void OnFeatureChanged();
        partial void OnCompatibleSchemaVersionChanging(string value);
        partial void OnCompatibleSchemaVersionChanged();
        partial void OnIsCurrentVersionChanging(bool value);
        partial void OnIsCurrentVersionChanged();
        #endregion

        public aspnet_SchemaVersion()
        {
            OnCreated();
        }

        [Column(Storage = "_Feature", DbType = "NVarChar(128) NOT NULL", CanBeNull = false, IsPrimaryKey = true)]
        public string Feature
        {
            get
            {
                return this._Feature;
            }
            set
            {
                if ((this._Feature != value))
                {
                    this.OnFeatureChanging(value);
                    this.SendPropertyChanging();
                    this._Feature = value;
                    this.SendPropertyChanged("Feature");
                    this.OnFeatureChanged();
                }
            }
        }

        [Column(Storage = "_CompatibleSchemaVersion", DbType = "NVarChar(128) NOT NULL", CanBeNull = false, IsPrimaryKey = true)]
        public string CompatibleSchemaVersion
        {
            get
            {
                return this._CompatibleSchemaVersion;
            }
            set
            {
                if ((this._CompatibleSchemaVersion != value))
                {
                    this.OnCompatibleSchemaVersionChanging(value);
                    this.SendPropertyChanging();
                    this._CompatibleSchemaVersion = value;
                    this.SendPropertyChanged("CompatibleSchemaVersion");
                    this.OnCompatibleSchemaVersionChanged();
                }
            }
        }

        [Column(Storage = "_IsCurrentVersion", DbType = "Bit NOT NULL")]
        public bool IsCurrentVersion
        {
            get
            {
                return this._IsCurrentVersion;
            }
            set
            {
                if ((this._IsCurrentVersion != value))
                {
                    this.OnIsCurrentVersionChanging(value);
                    this.SendPropertyChanging();
                    this._IsCurrentVersion = value;
                    this.SendPropertyChanged("IsCurrentVersion");
                    this.OnIsCurrentVersionChanged();
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [Table(Name = "dbo.aspnet_Users")]
    public partial class aspnet_User : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _ApplicationId;

        private System.Guid _UserId;

        private string _UserName;

        private string _LoweredUserName;

        private string _MobileAlias;

        private bool _IsAnonymous;

        private System.DateTime _LastActivityDate;

        private EntityRef<aspnet_Membership> _aspnet_Membership;

        private EntitySet<aspnet_PersonalizationPerUser> _aspnet_PersonalizationPerUsers;

        private EntityRef<aspnet_Profile> _aspnet_Profile;

        private EntitySet<aspnet_UsersInRole> _aspnet_UsersInRoles;

        private EntityRef<aspnet_Application> _aspnet_Application;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnApplicationIdChanging(System.Guid value);
        partial void OnApplicationIdChanged();
        partial void OnUserIdChanging(System.Guid value);
        partial void OnUserIdChanged();
        partial void OnUserNameChanging(string value);
        partial void OnUserNameChanged();
        partial void OnLoweredUserNameChanging(string value);
        partial void OnLoweredUserNameChanged();
        partial void OnMobileAliasChanging(string value);
        partial void OnMobileAliasChanged();
        partial void OnIsAnonymousChanging(bool value);
        partial void OnIsAnonymousChanged();
        partial void OnLastActivityDateChanging(System.DateTime value);
        partial void OnLastActivityDateChanged();
        #endregion

        public aspnet_User()
        {
            this._aspnet_Membership = default(EntityRef<aspnet_Membership>);
            this._aspnet_PersonalizationPerUsers = new EntitySet<aspnet_PersonalizationPerUser>(new Action<aspnet_PersonalizationPerUser>(this.attach_aspnet_PersonalizationPerUsers), new Action<aspnet_PersonalizationPerUser>(this.detach_aspnet_PersonalizationPerUsers));
            this._aspnet_Profile = default(EntityRef<aspnet_Profile>);
            this._aspnet_UsersInRoles = new EntitySet<aspnet_UsersInRole>(new Action<aspnet_UsersInRole>(this.attach_aspnet_UsersInRoles), new Action<aspnet_UsersInRole>(this.detach_aspnet_UsersInRoles));
            this._aspnet_Application = default(EntityRef<aspnet_Application>);
            OnCreated();
        }

        [Column(Storage = "_ApplicationId", DbType = "UniqueIdentifier NOT NULL")]
        public System.Guid ApplicationId
        {
            get
            {
                return this._ApplicationId;
            }
            set
            {
                if ((this._ApplicationId != value))
                {
                    if (this._aspnet_Application.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnApplicationIdChanging(value);
                    this.SendPropertyChanging();
                    this._ApplicationId = value;
                    this.SendPropertyChanged("ApplicationId");
                    this.OnApplicationIdChanged();
                }
            }
        }

        [Column(Storage = "_UserId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid UserId
        {
            get
            {
                return this._UserId;
            }
            set
            {
                if ((this._UserId != value))
                {
                    this.OnUserIdChanging(value);
                    this.SendPropertyChanging();
                    this._UserId = value;
                    this.SendPropertyChanged("UserId");
                    this.OnUserIdChanged();
                }
            }
        }

        [Column(Storage = "_UserName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string UserName
        {
            get
            {
                return this._UserName;
            }
            set
            {
                if ((this._UserName != value))
                {
                    this.OnUserNameChanging(value);
                    this.SendPropertyChanging();
                    this._UserName = value;
                    this.SendPropertyChanged("UserName");
                    this.OnUserNameChanged();
                }
            }
        }

        [Column(Storage = "_LoweredUserName", DbType = "NVarChar(256) NOT NULL", CanBeNull = false)]
        public string LoweredUserName
        {
            get
            {
                return this._LoweredUserName;
            }
            set
            {
                if ((this._LoweredUserName != value))
                {
                    this.OnLoweredUserNameChanging(value);
                    this.SendPropertyChanging();
                    this._LoweredUserName = value;
                    this.SendPropertyChanged("LoweredUserName");
                    this.OnLoweredUserNameChanged();
                }
            }
        }

        [Column(Storage = "_MobileAlias", DbType = "NVarChar(16)")]
        public string MobileAlias
        {
            get
            {
                return this._MobileAlias;
            }
            set
            {
                if ((this._MobileAlias != value))
                {
                    this.OnMobileAliasChanging(value);
                    this.SendPropertyChanging();
                    this._MobileAlias = value;
                    this.SendPropertyChanged("MobileAlias");
                    this.OnMobileAliasChanged();
                }
            }
        }

        [Column(Storage = "_IsAnonymous", DbType = "Bit NOT NULL")]
        public bool IsAnonymous
        {
            get
            {
                return this._IsAnonymous;
            }
            set
            {
                if ((this._IsAnonymous != value))
                {
                    this.OnIsAnonymousChanging(value);
                    this.SendPropertyChanging();
                    this._IsAnonymous = value;
                    this.SendPropertyChanged("IsAnonymous");
                    this.OnIsAnonymousChanged();
                }
            }
        }

        [Column(Storage = "_LastActivityDate", DbType = "DateTime NOT NULL")]
        public System.DateTime LastActivityDate
        {
            get
            {
                return this._LastActivityDate;
            }
            set
            {
                if ((this._LastActivityDate != value))
                {
                    this.OnLastActivityDateChanging(value);
                    this.SendPropertyChanging();
                    this._LastActivityDate = value;
                    this.SendPropertyChanged("LastActivityDate");
                    this.OnLastActivityDateChanged();
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_Membership", Storage = "_aspnet_Membership", ThisKey = "UserId", OtherKey = "UserId", IsUnique = true, IsForeignKey = false)]
        public aspnet_Membership aspnet_Membership
        {
            get
            {
                return this._aspnet_Membership.Entity;
            }
            set
            {
                aspnet_Membership previousValue = this._aspnet_Membership.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Membership.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Membership.Entity = null;
                        previousValue.aspnet_User = null;
                    }
                    this._aspnet_Membership.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_User = this;
                    }
                    this.SendPropertyChanged("aspnet_Membership");
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_PersonalizationPerUser", Storage = "_aspnet_PersonalizationPerUsers", ThisKey = "UserId", OtherKey = "UserId")]
        public EntitySet<aspnet_PersonalizationPerUser> aspnet_PersonalizationPerUsers
        {
            get
            {
                return this._aspnet_PersonalizationPerUsers;
            }
            set
            {
                this._aspnet_PersonalizationPerUsers.Assign(value);
            }
        }

        [Association(Name = "aspnet_User_aspnet_Profile", Storage = "_aspnet_Profile", ThisKey = "UserId", OtherKey = "UserId", IsUnique = true, IsForeignKey = false)]
        public aspnet_Profile aspnet_Profile
        {
            get
            {
                return this._aspnet_Profile.Entity;
            }
            set
            {
                aspnet_Profile previousValue = this._aspnet_Profile.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Profile.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Profile.Entity = null;
                        previousValue.aspnet_User = null;
                    }
                    this._aspnet_Profile.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_User = this;
                    }
                    this.SendPropertyChanged("aspnet_Profile");
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_UsersInRole", Storage = "_aspnet_UsersInRoles", ThisKey = "UserId", OtherKey = "UserId")]
        public EntitySet<aspnet_UsersInRole> aspnet_UsersInRoles
        {
            get
            {
                return this._aspnet_UsersInRoles;
            }
            set
            {
                this._aspnet_UsersInRoles.Assign(value);
            }
        }

        [Association(Name = "aspnet_Application_aspnet_User", Storage = "_aspnet_Application", ThisKey = "ApplicationId", OtherKey = "ApplicationId", IsForeignKey = true)]
        public aspnet_Application aspnet_Application
        {
            get
            {
                return this._aspnet_Application.Entity;
            }
            set
            {
                aspnet_Application previousValue = this._aspnet_Application.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Application.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Application.Entity = null;
                        previousValue.aspnet_Users.Remove(this);
                    }
                    this._aspnet_Application.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_Users.Add(this);
                        this._ApplicationId = value.ApplicationId;
                    }
                    else
                    {
                        this._ApplicationId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_Application");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private void attach_aspnet_PersonalizationPerUsers(aspnet_PersonalizationPerUser entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_User = this;
        }

        private void detach_aspnet_PersonalizationPerUsers(aspnet_PersonalizationPerUser entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_User = null;
        }

        private void attach_aspnet_UsersInRoles(aspnet_UsersInRole entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_User = this;
        }

        private void detach_aspnet_UsersInRoles(aspnet_UsersInRole entity)
        {
            this.SendPropertyChanging();
            entity.aspnet_User = null;
        }
    }

    [Table(Name = "dbo.aspnet_UsersInRoles")]
    public partial class aspnet_UsersInRole : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _UserId;

        private System.Guid _RoleId;

        private EntityRef<aspnet_Role> _aspnet_Role;

        private EntityRef<aspnet_User> _aspnet_User;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnUserIdChanging(System.Guid value);
        partial void OnUserIdChanged();
        partial void OnRoleIdChanging(System.Guid value);
        partial void OnRoleIdChanged();
        #endregion

        public aspnet_UsersInRole()
        {
            this._aspnet_Role = default(EntityRef<aspnet_Role>);
            this._aspnet_User = default(EntityRef<aspnet_User>);
            OnCreated();
        }

        [Column(Storage = "_UserId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid UserId
        {
            get
            {
                return this._UserId;
            }
            set
            {
                if ((this._UserId != value))
                {
                    if (this._aspnet_User.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnUserIdChanging(value);
                    this.SendPropertyChanging();
                    this._UserId = value;
                    this.SendPropertyChanged("UserId");
                    this.OnUserIdChanged();
                }
            }
        }

        [Column(Storage = "_RoleId", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid RoleId
        {
            get
            {
                return this._RoleId;
            }
            set
            {
                if ((this._RoleId != value))
                {
                    if (this._aspnet_Role.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnRoleIdChanging(value);
                    this.SendPropertyChanging();
                    this._RoleId = value;
                    this.SendPropertyChanged("RoleId");
                    this.OnRoleIdChanged();
                }
            }
        }

        [Association(Name = "aspnet_Role_aspnet_UsersInRole", Storage = "_aspnet_Role", ThisKey = "RoleId", OtherKey = "RoleId", IsForeignKey = true)]
        public aspnet_Role aspnet_Role
        {
            get
            {
                return this._aspnet_Role.Entity;
            }
            set
            {
                aspnet_Role previousValue = this._aspnet_Role.Entity;
                if (((previousValue != value)
                            || (this._aspnet_Role.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_Role.Entity = null;
                        previousValue.aspnet_UsersInRoles.Remove(this);
                    }
                    this._aspnet_Role.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_UsersInRoles.Add(this);
                        this._RoleId = value.RoleId;
                    }
                    else
                    {
                        this._RoleId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_Role");
                }
            }
        }

        [Association(Name = "aspnet_User_aspnet_UsersInRole", Storage = "_aspnet_User", ThisKey = "UserId", OtherKey = "UserId", IsForeignKey = true)]
        public aspnet_User aspnet_User
        {
            get
            {
                return this._aspnet_User.Entity;
            }
            set
            {
                aspnet_User previousValue = this._aspnet_User.Entity;
                if (((previousValue != value)
                            || (this._aspnet_User.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._aspnet_User.Entity = null;
                        previousValue.aspnet_UsersInRoles.Remove(this);
                    }
                    this._aspnet_User.Entity = value;
                    if ((value != null))
                    {
                        value.aspnet_UsersInRoles.Add(this);
                        this._UserId = value.UserId;
                    }
                    else
                    {
                        this._UserId = default(System.Guid);
                    }
                    this.SendPropertyChanged("aspnet_User");
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
